home *** CD-ROM | disk | FTP | other *** search
/ Net Power 2000 February / NetCD2.iso / Patch / age / age2cpfix.exe / data / GAMEDATA.DRS / Unnamed File 000022.bina < prev    next >
Encoding:
Text File  |  1999-11-11  |  27.9 KB  |  1,286 lines

  1. ;starting loads
  2. (load "petersen civ loads")
  3. (load "petersen difficulty loads")
  4. (load "petersen gather")
  5.  
  6. (load "petersen upgrades")
  7. (load "petersen castle")
  8. (load "petersen full tech")
  9.  
  10. (load "petersen rush")
  11.  
  12. (defrule
  13.     (true)
  14. =>
  15.     (set-goal military-parity YES)    ;goal 3
  16.     (set-goal attack-control NO)    ;goal 4
  17.     (set-goal resource-needed NO)    ;goal 5
  18.  
  19.     (set-goal rush-control NOTICE)    ;goal 6
  20.     (set-goal secondary-build NO)    ;goal 8
  21.     (set-goal combat-arm NOTICE)    ;goal 11
  22.  
  23.     (set-goal soldiers-available NO);goal 10
  24.     (set-goal combat-supp UNIT20)    ;goal 12
  25.     (set-goal age-advancement NO)    ;goal 14
  26.  
  27.     (disable-self)
  28. )
  29.  
  30. (defrule
  31.     (true)
  32. =>
  33.     (set-goal upgrade-conflict NO)    ;goal 16
  34.     (set-goal wonder-attempt MAYBE)    ;goal 20
  35.     (set-goal enemy-soldiers NO)    ;goal 26
  36.  
  37.     (set-goal get-mad NO)            ;goal 28
  38.     (set-goal siege-available YES)    ;goal 34
  39.     (disable-self)
  40. )
  41.  
  42. ;========================DARK AGE RULES
  43. (defrule
  44.     (true)
  45. =>
  46.     (set-strategic-number sn-coop-share-information 1)
  47.     (set-strategic-number sn-coop-share-attacking 1)
  48.     (set-strategic-number sn-maximum-town-size 15)
  49.  
  50.     (set-strategic-number sn-task-ungrouped-soldiers 0)
  51.     (set-strategic-number sn-zero-priority-distance 250)
  52.     (set-strategic-number sn-blot-exploration-map 0)
  53.  
  54.     (set-strategic-number sn-attack-intelligence 1)
  55.     (set-strategic-number sn-gather-defense-units 1)
  56.     (set-strategic-number sn-defense-distance 2)
  57.  
  58.     (set-strategic-number sn-maximum-gaia-attack-response 2)
  59.     (set-strategic-number sn-ignore-attack-group-under-attack 0)
  60.     (set-strategic-number sn-minimum-boar-hunt-group-size 5)
  61.     (disable-self)
  62. )
  63.  
  64. (defrule
  65.     (true)
  66. =>
  67.     (set-strategic-number sn-stone-dropsite-distance 3)
  68.     (set-strategic-number sn-gold-dropsite-distance 3)
  69.     (set-strategic-number sn-retask-gather-amount 20)
  70.     (set-strategic-number sn-camp-max-distance 20)
  71.  
  72.     (set-strategic-number sn-mill-max-distance 20)
  73.     (set-strategic-number sn-enemy-sighted-response-distance 10)
  74.     (set-strategic-number sn-group-form-distance 10)
  75.  
  76.     (set-strategic-number sn-allow-civilian-defense 1)
  77.     (disable-self)
  78. )
  79.  
  80. (defrule
  81.     (true)
  82. =>
  83.     (set-strategic-number sn-town-defend-priority 1)
  84.     (set-strategic-number sn-gold-defend-priority 2)
  85.     (set-strategic-number sn-stone-defend-priority 3)
  86.  
  87.     (set-strategic-number sn-forage-defend-priority 0)
  88.     (set-strategic-number sn-relic-defend-priority 0)
  89.     (set-strategic-number sn-cap-civilian-builders 8)
  90.  
  91.     (set-strategic-number sn-cap-civilian-gatherers 100)
  92.     (set-strategic-number sn-minimum-civilian-explorers 0)
  93.     (set-strategic-number sn-cap-civilian-explorers 0)
  94.  
  95.     (set-strategic-number sn-percent-civilian-explorers 0)
  96.     (disable-self)
  97. )
  98.  
  99. (defrule
  100.     (true)
  101. =>
  102.     (set-strategic-number sn-maximum-wood-drop-distance 20)
  103.     (set-strategic-number sn-maximum-food-drop-distance 20)
  104.     (set-strategic-number sn-maximum-hunt-drop-distance 40)
  105.  
  106.     (set-strategic-number sn-maximum-fish-boat-drop-distance 30)
  107.     (set-strategic-number sn-maximum-gold-drop-distance 20)
  108.     (set-strategic-number sn-maximum-stone-drop-distance 20)
  109.     (disable-self)
  110. )
  111.  
  112. ;start exploring
  113. (defrule
  114.     (or
  115.         (game-time > 600)
  116.         (and
  117.             (starting-resources < high-resources)
  118.             (difficulty > hardest)
  119.         )
  120.     )
  121. =>
  122.     (set-strategic-number sn-percent-civilian-builders 15)
  123.     (set-strategic-number sn-percent-civilian-gatherers 85)
  124.     (disable-self)
  125. )
  126.  
  127. (defrule
  128.     (or
  129.         (starting-resources == high-resources)
  130.         (difficulty == hardest)
  131.     )
  132. =>
  133.     (set-strategic-number sn-percent-civilian-builders 85)
  134.     (set-strategic-number sn-percent-civilian-gatherers 15)
  135.     (disable-self)
  136. )
  137.  
  138. ; explore a bit at need
  139. (defrule
  140.     (game-time < 600)
  141.     (military-population == 0)
  142.     (civilian-population < 15)
  143.     (or
  144.         (dropsite-min-distance food == -1)
  145.         (civilian-population > 10)
  146.     )
  147. =>
  148.     (set-strategic-number sn-minimum-civilian-explorers 1)
  149.     (set-strategic-number sn-cap-civilian-explorers 1)
  150.     (set-strategic-number sn-percent-civilian-explorers 5)
  151.     (set-strategic-number sn-percent-civilian-builders 15)
  152.     (set-strategic-number sn-percent-civilian-gatherers 80)
  153. )
  154.  
  155. ; Shut the explorers off when we get enough food
  156. (defrule
  157.     (strategic-number sn-percent-civilian-explorers > 0)
  158.     (or
  159.         (or
  160.             (game-time > 900)
  161.             (dropsite-min-distance food > -1)
  162.         )
  163.         (military-population > 0)
  164.     )
  165. =>
  166.     (set-strategic-number sn-percent-civilian-explorers 0)
  167.     (set-strategic-number sn-minimum-civilian-explorers 0)
  168.     (set-strategic-number sn-cap-civilian-explorers 0)
  169.     (set-strategic-number sn-percent-civilian-builders 15)
  170.     (set-strategic-number sn-percent-civilian-gatherers 85)
  171. )
  172.  
  173. (defrule
  174.     (or
  175.         (players-current-age any-enemy > feudal-age)
  176.         (players-military-population any-enemy > 2)
  177.     )
  178. =>
  179.     (set-strategic-number sn-allow-civilian-defense 0)
  180.     (disable-self)
  181. )
  182.  
  183. ; villager count
  184. (defrule
  185.     (current-age == dark-age)
  186.     (or
  187.         (civilian-population < civ-dark-rush)
  188.         (and
  189.             (nor
  190.                 (goal rush-control 2)
  191.                 (goal rush-control FEEDING)
  192.             )
  193.             (civilian-population < civ-dark)
  194.         )
  195.     )
  196.     (can-train villager)
  197. =>
  198.     (train villager)
  199. )
  200.  
  201. ;maintain housing
  202. (defrule
  203.     (difficulty <= moderate)
  204.     (housing-headroom < 5)
  205.     (population-headroom > 0)
  206.     (can-build house)
  207. =>
  208.     (build house)
  209. )
  210.  
  211. #load-if-defined DIFFICULTY-EASIEST
  212. (defrule
  213.     (military-population < 10)
  214.     (housing-headroom < 5)
  215.     (population-headroom > 0)
  216.     (can-build house)
  217. =>
  218.     (build house)
  219. )
  220. #end-if
  221.  
  222. #load-if-defined DIFFICULTY-EASY
  223. (defrule
  224.     (military-population < civ-dark-rush)
  225.     (housing-headroom < 5)
  226.     (population-headroom > 0)
  227.     (can-build house)
  228. =>
  229.     (build house)
  230. )
  231. #end-if
  232.  
  233. ;maintain a town center
  234. (defrule
  235.     (game-time > 45)
  236.     (building-type-count town-center < 1)
  237.     (can-build town-center)
  238. =>
  239.     (build town-center)
  240. )
  241.  
  242. ; Build a mill when we find food
  243. (defrule
  244.     (building-type-count-total house > 0)
  245.     (building-type-count-total mill == 0)
  246.     (or
  247.         (resource-found food)
  248.         (game-time > 900)
  249.     )
  250.     (can-build mill)
  251. =>
  252.     (build mill)
  253. )
  254.  
  255. (defrule
  256.     (game-time > 90)
  257.     (resource-found wood)
  258.     (building-type-count-total house > 0)
  259.     (building-type-count-total lumber-camp == 0)
  260.     (can-build lumber-camp)
  261. =>
  262.     (build lumber-camp)
  263. )
  264.  
  265. ;build farms
  266. (defrule
  267.     (building-type-count-total lumber-camp > 0)
  268.     (building-type-count-total mill > 0)
  269.     (idle-farm-count <= 1)
  270.     (sheep-and-forage-too-far)
  271.     (can-build farm)
  272.     (not (goal wonder-attempt YES) )
  273. =>
  274.     (build farm)
  275. )
  276.  
  277. (defrule
  278.     (building-type-count-total barracks == 0)
  279.     (can-build-with-escrow barracks)
  280.     (or
  281.         (and
  282.             (building-type-count-total lumber-camp > 0)
  283.             (building-type-count-total mill > 0)
  284.         )
  285.         (current-age > dark-age)
  286.     )
  287. =>
  288.     (release-escrow wood)
  289.     (build barracks)
  290. )
  291.  
  292. (defrule
  293.     (building-type-count-total barracks == 1)
  294.     (can-build-with-escrow barracks)
  295.     (goal rush-control RUSHING)
  296.     (unit-type-count villager > civ-dark)
  297.     (not (goal 1 10) )
  298. =>
  299.     (release-escrow wood)
  300.     (build-forward barracks)
  301. )
  302.  
  303. (defrule
  304.     (current-age == dark-age)
  305.     (building-type-count-total mining-camp == 0)
  306.     (goal resource-needed GOLD)
  307.     (resource-found gold)
  308.     (can-build mining-camp)
  309. =>
  310.     (build mining-camp)
  311. )
  312.  
  313.  
  314. ;=======================FEUDAL AGE RULES
  315. (defrule
  316.     (current-age >= feudal-age)
  317. =>
  318.     (set-strategic-number sn-maximum-town-size feudal-town-size)
  319.     (set-strategic-number sn-percent-civilian-builders 15)
  320.     (set-strategic-number sn-percent-civilian-gatherers 85)
  321.  
  322.     (set-strategic-number sn-camp-max-distance 35)
  323.     (set-strategic-number sn-mill-max-distance 35)
  324.     (set-strategic-number sn-group-form-distance 20)
  325.  
  326.     (set-strategic-number sn-enemy-sighted-response-distance 10)
  327.     (set-strategic-number sn-ignore-attack-group-under-attack 1)
  328.     (disable-self)
  329. )
  330.  
  331. (defrule
  332.     (current-age >= feudal-age)
  333. =>
  334.     (set-goal combat-supp UNIT20)
  335.     (set-goal age-advancement NO)
  336.     (enable-timer t-production 1)
  337.     (enable-timer t-lumbercamp 1)
  338.     (disable-timer t-ageup)
  339.     (disable-self)
  340. )
  341.  
  342. (defrule
  343.     (current-age == feudal-age)
  344.     (current-age-time < 600)
  345.     (wood-amount > 500)
  346. =>
  347.     (set-strategic-number sn-percent-civilian-builders 50)
  348.     (set-strategic-number sn-percent-civilian-gatherers 50)
  349.     (disable-self)
  350. )
  351.  
  352. (defrule
  353.     (current-age == feudal-age)
  354.     (current-age-time >= 600)
  355. =>
  356.     (set-strategic-number sn-percent-civilian-builders 15)
  357.     (set-strategic-number sn-percent-civilian-gatherers 85)
  358.     (disable-self)
  359. )
  360.  
  361. ; villager count
  362. (defrule
  363.     (current-age == feudal-age)
  364.     (or
  365.         (civilian-population < civ-feudal)
  366.         (and
  367.             (or
  368.                 (goal rush-control BOOMING)
  369.                 (goal rush-control FEEDING)
  370.             )
  371.             (civilian-population < civ-castle)
  372.         )
  373.     )
  374.     (can-train villager)
  375. =>
  376.     (train villager)
  377. )
  378.  
  379. ;periodically task idle guys, so they don't clog up production
  380. (defrule
  381.     (timer-triggered t-lumbercamp)
  382.     (strategic-number sn-task-ungrouped-soldiers == 0)
  383. =>
  384.     (set-strategic-number sn-task-ungrouped-soldiers 1)
  385. )
  386.  
  387. (defrule
  388.     (timer-triggered t-lumbercamp)
  389.     (strategic-number sn-task-ungrouped-soldiers == 1)
  390. =>
  391.     (set-strategic-number sn-task-ungrouped-soldiers 0)
  392. )
  393.  
  394. ; Build camps at need
  395. (defrule
  396.     (timer-triggered t-lumbercamp)
  397.     (current-age >= feudal-age)
  398.     (resource-found wood)
  399.     (dropsite-min-distance wood > 5)
  400.     (can-build lumber-camp)
  401. =>
  402.     (build lumber-camp)
  403. )
  404.  
  405. (defrule
  406.     (current-age >= feudal-age)
  407.     (resource-found gold)
  408.     (building-type-count-total mining-camp == 0)
  409.     (can-build-with-escrow mining-camp)
  410. =>
  411.     (release-escrow wood)
  412.     (build mining-camp)
  413. )
  414.  
  415. (defrule
  416.     (current-age >= feudal-age)
  417.     (resource-found stone)
  418.     (building-type-count-total mining-camp == 1)
  419.     (can-build-with-escrow mining-camp)
  420. =>
  421.     (release-escrow wood)
  422.     (build mining-camp)
  423. )
  424.  
  425. (defrule
  426.     (timer-triggered t-lumbercamp)
  427.     (current-age >= feudal-age)
  428.     (building-type-count-total market > 0)
  429.     (building-type-count-total blacksmith > 0)
  430.     (building-type-count-total mining-camp >= 1)
  431.     (building-type-count-total mining-camp < mining-count)
  432.     (resource-found gold)
  433.     (resource-found stone)
  434.     (or
  435.         (dropsite-min-distance gold > 7)
  436.         (dropsite-min-distance stone > 7)
  437.     )
  438.     (can-build mining-camp)
  439. =>
  440.     (build mining-camp)
  441. )
  442.  
  443. (defrule
  444.     (timer-triggered t-lumbercamp)
  445. =>
  446.     (disable-timer t-lumbercamp)
  447.     (enable-timer t-lumbercamp 30)
  448. )
  449.  
  450. (defrule
  451.     (building-type-count-total archery-range == 0)
  452.     (or
  453.         (goal rush-control 3)
  454.         (goal rush-control RUSHING)
  455.     )
  456.     (or
  457.         (or
  458.             (goal combat-arm CAVARCHER)
  459.             (goal combat-arm ARCHER)
  460.         )
  461.         (or
  462.             (goal pre-unique-arm CAVARCHER)
  463.             (goal pre-unique-arm ARCHER)
  464.         )
  465.     )
  466.     (can-build-with-escrow archery-range)
  467. =>
  468.     (release-escrow wood)
  469.     (build archery-range)
  470. )
  471.  
  472. (defrule
  473.     (goal combat-arm LIGHTCAV)
  474.     (building-type-count-total stable == 0)
  475.     (or
  476.         (goal rush-control 3)
  477.         (goal rush-control RUSHING)
  478.     )
  479.     (can-build-with-escrow stable)
  480. =>
  481.     (release-escrow wood)
  482.     (build stable)
  483. )
  484.  
  485. ;feudal age market -- always keep a market handy!
  486. (defrule
  487.     (building-type-count-total market == 0)
  488.     (can-build-with-escrow market)
  489. =>
  490.     (release-escrow wood)
  491.     (build market)
  492. )
  493.  
  494. ;get a blacksmith
  495. (defrule
  496.     (building-type-count-total market > 0)
  497.     (building-type-count-total barracks > 0)
  498.     (building-type-count-total blacksmith == 0)
  499.     (can-build-with-escrow blacksmith)
  500. =>
  501.     (release-escrow wood)
  502.     (build blacksmith)
  503. )
  504.  
  505. (defrule
  506.     (building-type-count-total market > 0)
  507.     (building-type-count-total archery-range == 0)
  508.     (or
  509.         (or
  510.             (goal combat-arm CAVARCHER)
  511.             (goal combat-arm ARCHER)
  512.         )
  513.         (or
  514.             (or
  515.                 (goal combat-supp CAVARCHER)
  516.                 (goal combat-supp ARCHER)
  517.             )
  518.             (or
  519.                 (goal pre-unique-arm CAVARCHER)
  520.                 (goal pre-unique-arm ARCHER)
  521.             )
  522.         )
  523.     )
  524.     (can-build-with-escrow archery-range)
  525. =>
  526.     (release-escrow wood)
  527.     (build archery-range)
  528. )
  529.  
  530. (defrule
  531.     (building-type-count-total market > 0)
  532.     (building-type-count-total stable == 0)
  533.     (or
  534.         (or
  535.             (goal combat-arm CAVALRY)
  536.             (goal combat-arm LIGHTCAV)
  537.         )
  538.         (or
  539.             (or
  540.                 (goal combat-supp CAVALRY)
  541.                 (goal combat-supp LIGHTCAV)
  542.             )
  543.             (or
  544.                 (goal pre-unique-arm CAVALRY)
  545.                 (goal pre-unique-arm LIGHTCAV)
  546.             )
  547.         )
  548.     )
  549.     (can-build-with-escrow stable)
  550. =>
  551.     (release-escrow wood)
  552.     (build stable)
  553. )
  554.  
  555. (defrule
  556.     (current-age >= feudal-age)
  557.     (current-age-time > 300)
  558.     (building-type-count-total mill < feudal-mill-count)
  559.     (wood-amount > 400)
  560.     (can-build mill)
  561. =>
  562.     (build mill)
  563. )
  564.  
  565. (defrule
  566.     (cc-players-building-type-count any-ally market > 0)
  567.     (unit-type-count-total trade-cart == 0)
  568.     (wood-amount > 300)
  569.     (gold-amount > 300)
  570.     (nor
  571.         (town-under-attack)
  572.         (and
  573.             (goal 1 10)
  574.             (not (map-type team-islands) )
  575.         )
  576.     )
  577.     (can-train trade-cart)
  578. =>
  579.     (train trade-cart)
  580.     (disable-self)
  581. )
  582.  
  583. (defrule
  584.     (current-age == imperial-age)
  585.     (cc-players-building-type-count any-ally market > 0)
  586.     (unit-type-count-total trade-cart == 0)
  587.     (wood-amount > 300)
  588.     (gold-amount > 300)
  589.     (nor
  590.         (town-under-attack)
  591.         (and
  592.             (goal 1 10)
  593.             (not (map-type team-islands) )
  594.         )
  595.     )
  596.     (can-train trade-cart)
  597. =>
  598.     (train trade-cart)
  599.     (disable-self)
  600. )
  601.  
  602. (defrule
  603.     (cc-players-building-type-count any-ally dock >= 1)
  604.     (unit-type-count-total trade-cog == 0)
  605.     (wood-amount > 300)
  606.     (gold-amount > 300)
  607.     (not (goal 1 0) )
  608.     (can-train trade-cog)
  609. =>
  610.     (train trade-cog)
  611.     (disable-self)
  612. )
  613.  
  614. (defrule
  615.     (current-age == imperial-age)
  616.     (cc-players-building-type-count any-ally dock >= 1)
  617.     (unit-type-count-total trade-cog == 0)
  618.     (wood-amount > 300)
  619.     (gold-amount > 300)
  620.     (not (goal 1 0) )
  621.     (can-train trade-cog)
  622. =>
  623.     (train trade-cog)
  624.     (disable-self)
  625. )
  626.  
  627. ;======================== CASTLE AGE RULES
  628. ;see age advancement rules for strategic number-settings
  629. (defrule
  630.     (current-age >= castle-age)
  631. =>
  632.     (set-strategic-number sn-sentry-distance 4)
  633.     (set-strategic-number sn-maximum-town-size castle-town-size)
  634.     (set-strategic-number sn-percent-civilian-builders 15)
  635.  
  636.     (set-strategic-number sn-percent-civilian-gatherers 85)
  637.     (set-strategic-number sn-blot-exploration-map 1)
  638.     (set-strategic-number sn-camp-max-distance 50)
  639.  
  640.     (set-strategic-number sn-mill-max-distance 50)
  641.     (set-strategic-number sn-group-form-distance 30)
  642.     (set-strategic-number sn-enemy-sighted-response-distance 15)
  643.  
  644.     (set-goal age-advancement NO)
  645.     (disable-timer t-ageup)
  646.  
  647.     (disable-self)
  648. )
  649.  
  650. ; villager count
  651. (defrule
  652.     (current-age == castle-age)
  653.     (civilian-population < civ-castle)
  654.     (can-train villager)
  655. =>
  656.     (train villager)
  657. )
  658.  
  659. ;Siege Workshop
  660. (defrule
  661.     (building-type-count-total siege-workshop == 0)
  662.     (can-build-with-escrow siege-workshop)
  663. =>
  664.     (release-escrow wood)
  665.     (build siege-workshop)
  666. )
  667.  
  668. ;University & maintain it
  669. (defrule
  670.     (building-type-count-total university == 0)
  671.     (or
  672.         (building-type-count-total siege-workshop > 0)
  673.         (wood-amount > 500)
  674.     )
  675.     (can-build-with-escrow university)
  676. =>
  677.     (release-escrow wood)
  678.     (build university)
  679. )
  680.  
  681. ; Build a monastery
  682. (defrule
  683.     (building-type-count-total monastery == 0)
  684.     (or
  685.         (goal monk-rating GOOD)
  686.         (or
  687.             (building-type-count-total siege-workshop > 0)
  688.             (wood-amount > 500)
  689.         )
  690.     )
  691.     (not (goal monk-rating NO) )
  692.     (can-build-with-escrow monastery)
  693. =>
  694.     (release-escrow wood)
  695.     (build monastery)
  696. )
  697.  
  698. (defrule
  699.     (goal monk-rating GOOD)
  700.     (building-type-count-total monastery < 2)
  701.     (building-type-count-total siege-workshop > 0)
  702.     (can-build monastery)
  703. =>
  704.     (build monastery)
  705. )
  706.  
  707. (defrule
  708.     (current-age >= castle-age)
  709.     (current-age-time > 300)
  710.     (building-type-count-total mill < castle-mill-count)
  711.     (wood-amount > 500)
  712.     (can-build mill)
  713. =>
  714.     (build mill)
  715. )
  716.  
  717. ;=============================IMPERIAL AGE RULES
  718. ;see age advancement rules for strategic number-settings
  719. (defrule
  720.     (current-age == imperial-age)
  721. =>
  722.     (set-strategic-number sn-maximum-town-size imperial-town-size)
  723.     (set-strategic-number sn-percent-civilian-builders 15)
  724.     (set-strategic-number sn-percent-civilian-gatherers 85)
  725.     (set-strategic-number sn-camp-max-distance 50)
  726.  
  727.     (set-strategic-number sn-mill-max-distance 50)
  728.     (set-strategic-number sn-enemy-sighted-response-distance 15)
  729.  
  730.     (set-goal age-advancement NO)
  731.     (disable-self)
  732. )
  733.  
  734. (defrule
  735.     (current-age == imperial-age)
  736.     (or
  737.         (and
  738.             (current-age-time < 1800)
  739.             (civilian-population < civ-castle)
  740.         )
  741.         (civilian-population < civ-feudal)
  742.     )
  743.     (can-train villager)
  744. =>
  745.     (train villager)
  746. )
  747.  
  748. (defrule
  749.     (current-age == imperial-age)
  750.     (population >= pop-cap)
  751.     (or
  752.         (and
  753.             (current-age-time < 1800)
  754.             (civilian-population > civ-castle)
  755.         )
  756.         (civilian-population > civ-feudal)
  757.     )
  758. =>
  759.     (delete-unit villager)
  760. )    
  761.  
  762. ;another town center?
  763. (defrule
  764.     (current-age == imperial-age)
  765.     (building-type-count town-center < town-center-count)
  766.     (wood-amount > 400)
  767.     (can-build town-center)
  768. =>
  769.     (build town-center)
  770. )
  771.  
  772. (defrule
  773.     (current-age == imperial-age)
  774.     (current-age-time > 300)
  775.     (building-type-count-total mill < imperial-mill-count)
  776.     (wood-amount > 700)
  777.     (can-build mill)
  778. =>
  779.     (build mill)
  780. )
  781.  
  782. ;****************
  783. ;forward builders!
  784. ; start the run-through for island maps
  785. (defrule
  786.     (goal 1 10)
  787.     (goal rush-control RUSHING)
  788.     (difficulty <= moderate)
  789.     (building-type-count barracks == 1)
  790.     (building-type-count-total blacksmith > 0)
  791.     (strategic-number sn-number-forward-builders == 0)
  792.     (unit-type-count villager >= civ-dark-rush)
  793.     (goal combat-arm INFANTRY)
  794. =>
  795.     (set-strategic-number sn-number-forward-builders 1)
  796. )
  797.  
  798. (defrule
  799.     (goal 1 10)
  800.     (goal rush-control RUSHING)
  801.     (difficulty <= moderate)
  802.     (building-type-count stable == 1)
  803.     (building-type-count-total university > 0)
  804.     (strategic-number sn-number-forward-builders == 0)
  805.     (unit-type-count villager >= civ-dark-rush)
  806.     (or
  807.         (goal combat-arm CAVALRY)
  808.         (goal combat-arm LIGHTCAV)
  809.     )
  810. =>
  811.     (set-strategic-number sn-number-forward-builders 1)
  812. )
  813.  
  814. (defrule
  815.     (goal 1 10)
  816.     (goal rush-control RUSHING)
  817.     (difficulty <= moderate)
  818.     (building-type-count archery-range == 1)
  819.     (building-type-count-total market > 0)
  820.     (strategic-number sn-number-forward-builders == 0)
  821.     (unit-type-count villager >= civ-dark-rush)
  822.     (or
  823.         (goal combat-arm CAVARCHER)
  824.         (goal combat-arm ARCHER)
  825.     )
  826. =>
  827.     (set-strategic-number sn-number-forward-builders 1)
  828. )
  829.  
  830. (defrule
  831.     (goal 1 10)
  832.     (goal rush-control RUSHING)
  833.     (difficulty <= hard)
  834.     (building-type-count siege-workshop == 1)
  835.     (strategic-number sn-number-forward-builders == 0)
  836.     (unit-type-count villager >= civ-dark-rush)
  837.     (or
  838.         (or
  839.             (building-type-count-total archery-range > 1)
  840.             (building-type-count-total castle > 1)
  841.         )
  842.         (or
  843.             (building-type-count-total barracks > 1)
  844.             (building-type-count-total stable > 1)
  845.         )
  846.     )
  847. =>
  848.     (set-strategic-number sn-number-forward-builders 1)
  849. )
  850.  
  851. (defrule
  852.     (goal 1 10)
  853.     (goal rush-control RUSHING)
  854.     (difficulty <= hard)
  855.     (goal castle-attempt 2)
  856.     (unit-type-count villager > civ-dark-rush)
  857.     (building-type-count-total castle < 3)
  858.     (can-build-with-escrow castle)
  859. =>
  860.     (set-strategic-number sn-number-forward-builders 3)
  861. )
  862.  
  863. (defrule
  864.     (goal 1 10)
  865.     (or
  866.         (or
  867.             (unit-type-count transport-ship == 0)
  868.             (attack-soldier-count < ten-percent-pop)
  869.         )
  870.         (or
  871.             (or
  872.                 (unit-type-count villager < 10)
  873.                 (not (goal rush-control RUSHING) )
  874.             )
  875.             (or
  876.                 (goal military-parity NO)
  877.                 (town-under-attack)
  878.             )
  879.         )
  880.     )
  881.     (strategic-number sn-number-forward-builders >= 1)
  882. =>
  883.     (set-strategic-number sn-number-forward-builders 0)
  884. )
  885.  
  886. (defrule
  887.     (goal rush-control RUSHING)
  888.     (goal castle-attempt 2)
  889.     (difficulty <= hard)
  890.     (unit-type-count villager > civ-feudal)
  891.     (building-type-count-total castle < 3)
  892.     (can-build-with-escrow castle)
  893. =>
  894.     (release-escrow stone)
  895.     (build-forward castle)
  896. )
  897.  
  898. (defrule
  899.     (goal castle-attempt 2)
  900.     (difficulty <= hard)
  901.     (unit-type-count villager > civ-dark-rush)
  902.     (building-type-count-total castle < 3)
  903.     (can-build-with-escrow castle)
  904.     (nor
  905.         (goal wonder-attempt POSSIBLE)
  906.         (goal rush-control RUSHING)
  907.     )
  908. =>
  909.     (release-escrow stone)
  910.     (build castle)
  911. )
  912.  
  913. (defrule
  914.     (difficulty <= moderate)
  915.     (unit-type-count villager > civ-dark)
  916.     (building-type-count barracks < 3)
  917.     (building-type-count barracks == 1)
  918.     (can-build barracks)
  919.     (or
  920.         (goal combat-arm INFANTRY)
  921.         (current-age == dark-age)
  922.     )
  923.     (or
  924.         (goal rush-control RUSHING)
  925.         (goal rush-control 2)
  926.     )
  927. =>
  928.     (build-forward barracks)
  929. )
  930.  
  931. (defrule
  932.     (difficulty <= moderate)
  933.     (building-type-count barracks < 3)
  934.     (current-age > feudal-age)
  935.     (can-build barracks)
  936.     (nor
  937.         (goal rush-control RUSHING)
  938.         (goal rush-control 2)
  939.     )
  940.     (or
  941.         (goal combat-arm INFANTRY)
  942.         (goal combat-supp INFANTRY)
  943.     )
  944. =>
  945.     (build barracks)
  946. )
  947.  
  948. (defrule
  949.     (goal rush-control RUSHING)
  950.     (difficulty <= moderate)
  951.     (building-type-count archery-range == 1)
  952.     (building-type-count-total market > 0)
  953.     (unit-type-count villager > civ-dark)
  954.     (can-build archery-range)
  955.     (or
  956.         (goal combat-arm CAVARCHER)
  957.         (goal combat-arm ARCHER)
  958.     )
  959. =>
  960.     (build-forward archery-range)
  961. )
  962.  
  963. (defrule
  964.     (difficulty <= moderate)
  965.     (building-type-count archery-range < 3)
  966.     (building-type-count-total market > 0)
  967.     (can-build archery-range)
  968.     (not (goal rush-control RUSHING) )
  969.     (or
  970.         (or
  971.             (goal combat-arm CAVARCHER)
  972.             (goal combat-arm ARCHER)
  973.         )
  974.         (or
  975.             (goal combat-supp CAVARCHER)
  976.             (goal combat-supp ARCHER)
  977.         )
  978.     )
  979. =>
  980.     (build archery-range)
  981. )
  982.  
  983. (defrule
  984.     (goal rush-control RUSHING)
  985.     (difficulty <= moderate)
  986.     (building-type-count stable == 1)
  987.     (building-type-count-total university > 0)
  988.     (unit-type-count villager > civ-dark)
  989.     (can-build stable)
  990.     (or
  991.         (goal combat-arm CAVALRY)
  992.         (goal combat-arm LIGHTCAV)
  993.     )
  994. =>
  995.     (build-forward stable)
  996. )
  997.  
  998. (defrule
  999.     (difficulty <= moderate)
  1000.     (building-type-count stable < 3)
  1001.     (building-type-count-total university > 0)
  1002.     (can-build stable)
  1003.     (not (goal rush-control RUSHING) )
  1004.     (or
  1005.         (or
  1006.             (goal combat-arm CAVALRY)
  1007.             (goal combat-arm LIGHTCAV)
  1008.         )
  1009.         (or
  1010.             (goal combat-supp CAVALRY)
  1011.             (goal combat-supp LIGHTCAV)
  1012.         )
  1013.     )
  1014. =>
  1015.     (build stable)
  1016. )
  1017.  
  1018. (defrule
  1019.     (goal rush-control RUSHING)
  1020.     (difficulty <= hard)
  1021.     (building-type-count siege-workshop == 1)
  1022.     (can-build siege-workshop)
  1023.     (unit-type-count villager > civ-feudal)
  1024.     (or
  1025.         (or
  1026.             (building-type-count-total archery-range > 1)
  1027.             (building-type-count-total castle > 1)
  1028.         )
  1029.         (or
  1030.             (building-type-count-total barracks > 1)
  1031.             (building-type-count-total stable > 1)
  1032.         )
  1033.     )
  1034. =>
  1035.     (build-forward siege-workshop)
  1036. )
  1037.  
  1038. (defrule
  1039.     (difficulty <= hard)
  1040.     (building-type-count siege-workshop == 1)
  1041.     (can-build siege-workshop)
  1042.     (or
  1043.         (or
  1044.             (building-type-count-total archery-range > 1)
  1045.             (building-type-count-total castle > 1)
  1046.         )
  1047.         (or
  1048.             (building-type-count-total barracks > 1)
  1049.             (building-type-count-total stable > 1)
  1050.         )
  1051.     )
  1052.     (not (goal rush-control RUSHING) )
  1053. =>
  1054.     (build siege-workshop)
  1055. )
  1056.  
  1057. ;**************************************
  1058. ;BASIC DIPLOMACY
  1059. #load-if-not-defined TEAMS-LOCKED
  1060. (defrule
  1061.     (current-age >= feudal-age)
  1062.     (players-stance any-computer-ally neutral)
  1063. =>
  1064.     (set-stance this-any-computer-ally neutral)
  1065. )
  1066.  
  1067. (defrule
  1068.     (current-age >= feudal-age)
  1069.     (players-stance any-computer-ally enemy)
  1070. =>
  1071.     (set-stance this-any-computer-ally enemy)
  1072. )
  1073.  
  1074. (defrule
  1075.     (current-age >= feudal-age)
  1076.     (players-stance any-computer-neutral ally)
  1077. =>
  1078.     (set-stance this-any-computer-neutral ally)
  1079. )
  1080.  
  1081. (defrule
  1082.     (current-age >= feudal-age)
  1083.     (players-stance any-computer-neutral enemy)
  1084. =>
  1085.     (set-stance this-any-computer-neutral enemy)
  1086. )
  1087.  
  1088. (defrule
  1089.     (current-age >= feudal-age)
  1090.     (players-stance any-computer-enemy ally)
  1091. =>
  1092.     (set-stance this-any-computer-enemy ally)
  1093. )
  1094.  
  1095. (defrule
  1096.     (current-age >= feudal-age)
  1097.     (players-stance any-computer-enemy neutral)
  1098. =>
  1099.     (set-stance this-any-computer-enemy neutral)
  1100. )
  1101.  
  1102. ;BASIC DIPLOMACY VS. HUMANS
  1103. ;if the human player doesn't go neutral at our request
  1104. (defrule
  1105.     (goal get-mad NO)
  1106.     (players-stance any-human-neutral enemy)
  1107.     (or
  1108.         (difficulty <= moderate)
  1109.         (current-age > dark-age)
  1110.     )
  1111. =>
  1112.     (chat-to-player-using-id this-any-human-neutral 22027)
  1113.         ;"I am Neutral to thee. Set thy diplomacy to Neutral to me."
  1114.     (disable-timer t-chathelp)
  1115.     (enable-timer t-chathelp 120)
  1116.     (set-goal get-mad ANGRY)
  1117. )
  1118.  
  1119. (defrule
  1120.     (not (goal get-mad NO) )
  1121.     (or
  1122.         (players-stance any-human-neutral neutral)
  1123.         (players-stance any-human-neutral ally)
  1124.     )
  1125. =>
  1126.     (chat-to-player-using-id this-any-human-neutral 22028)
  1127.     (chat-to-player-using-id this-any-human-neutral 22029)
  1128.         ;"Thou art wise to be a potential friend."
  1129.         ;"Thou shalt hear from me again."
  1130.     (disable-timer t-chathelp)
  1131.     (set-goal get-mad NO)
  1132. )
  1133.  
  1134. (defrule
  1135.     (goal get-mad ANGRY)
  1136.     (timer-triggered t-chathelp)
  1137.     (players-stance any-human-neutral enemy)
  1138. =>
  1139.     (set-goal get-mad ANGRIER)
  1140.     (disable-timer t-chathelp)
  1141.     (enable-timer t-chathelp 180)
  1142.     (chat-to-player-using-id this-any-human-neutral 22030)
  1143.     (chat-to-player-using-id this-any-human-neutral 22031)
  1144.         ;"Thou hast ignored my generous invitation. I am merciful, and give you another chance."
  1145.         ;"Set thy diplomacy to Neutral to me. Now."
  1146. )
  1147.  
  1148. (defrule
  1149.     (goal get-mad ANGRIER)
  1150.     (timer-triggered t-chathelp)
  1151.     (players-stance any-human-neutral enemy)
  1152. =>
  1153.     (set-goal get-mad ANGRIEST)
  1154.     (disable-timer t-chathelp)
  1155.     (enable-timer t-chathelp 180)
  1156.     (chat-to-player-using-id this-any-human-neutral 22032)
  1157.     (chat-to-player-using-id this-any-human-neutral 22033)
  1158.         ;"How unwise. Thou art still hostile to me. Set to Neutral at once versus me!"
  1159.         ;"This is thy last opportunity."
  1160. )
  1161.  
  1162. (defrule
  1163.     (goal get-mad ANGRIEST)
  1164.     (timer-triggered t-chathelp)
  1165.     (players-stance any-human-neutral enemy)
  1166. =>
  1167.     (set-goal personality 10)
  1168.     (disable-timer t-chathelp)
  1169.     (disable-self)
  1170. )
  1171.  
  1172. ;when an ally turns on us
  1173. (defrule
  1174.     (goal get-mad NO)
  1175.     (or
  1176.         (players-stance any-human-ally neutral)
  1177.         (players-stance any-human-ally enemy)
  1178.     )
  1179. =>
  1180.     (chat-to-player-using-id this-any-human-ally 22147)
  1181.         ;"I am thine Ally, friend. Pray set thine diplomacy to Ally, too."
  1182.     (disable-timer t-chathelp)
  1183.     (enable-timer t-chathelp 120)
  1184.     (set-goal get-mad ANGRY)
  1185. )
  1186.  
  1187. (defrule
  1188.     (not (goal get-mad NO) )
  1189.     (players-stance any-human-ally ally)
  1190. =>
  1191.     (chat-to-player-using-id this-any-human-ally 22148)
  1192.         ;"Thou art gracious to remain mine friend."
  1193.     (disable-timer t-chathelp)
  1194.     (set-goal get-mad NO)
  1195. )
  1196.  
  1197. (defrule
  1198.     (goal get-mad ANGRY)
  1199.     (timer-triggered t-chathelp)
  1200.     (or
  1201.         (players-stance any-human-ally neutral)
  1202.         (players-stance any-human-ally enemy)
  1203.     )
  1204. =>
  1205.     (set-goal get-mad ANGRIER)
  1206.     (disable-timer t-chathelp)
  1207.     (enable-timer t-chathelp 180)
  1208.     (chat-to-player-using-id this-any-human-ally 22149)
  1209.     (chat-to-player-using-id this-any-human-ally 22150)
  1210.         ;"What evil is this? Thou art still not friendly?!"
  1211.         ;"Perhaps thou didst not understand? Be mine Ally, for I am thine."
  1212. )
  1213.  
  1214. (defrule
  1215.     (goal get-mad ANGRIER)
  1216.     (timer-triggered t-chathelp)
  1217.     (or
  1218.         (players-stance any-human-ally neutral)
  1219.         (players-stance any-human-ally enemy)
  1220.     )
  1221. =>
  1222.     (set-goal get-mad ANGRIEST)
  1223.     (disable-timer t-chathelp)
  1224.     (enable-timer t-chathelp 180)
  1225.     (chat-to-player-using-id this-any-human-ally 22151)
  1226.     (chat-to-player-using-id this-any-human-ally 22152)
  1227.         ;"Oh, falsest of friends. This is thy last chance!"
  1228.         ;"If thou wilt have me for Ally, thou must do likewise."
  1229. )
  1230.  
  1231. (defrule
  1232.     (goal get-mad ANGRIEST)
  1233.     (timer-triggered t-chathelp)
  1234.     (or
  1235.         (players-stance any-human-ally neutral)
  1236.         (players-stance any-human-ally enemy)
  1237.     )
  1238. =>
  1239.     (set-goal personality 10)
  1240.     (disable-timer t-chathelp)
  1241.     (disable-self)
  1242. )
  1243.  
  1244. ;end result -- go hostile!!
  1245. (defrule
  1246.     (stance-toward any-human neutral)
  1247.     (nor
  1248.         (player-in-game any-computer-ally)
  1249.         (or
  1250.             (player-in-game any-computer-enemy)
  1251.             (player-in-game any-computer-neutral)
  1252.         )
  1253.     )
  1254. =>
  1255.     (chat-to-player-using-id this-any-human 22034)
  1256.     (chat-to-player-using-id this-any-human 22035)
  1257.         ;"I have thought better of mine previous merciful plan."
  1258.         ;"Thou must be exterminated, and I shall forever be thine foe."
  1259.     (set-stance this-any-human enemy)
  1260.     (set-stance every-computer ally)
  1261.     (set-goal personality 12)
  1262.     (disable-timer t-chathelp)
  1263.     (disable-timer t-chat)
  1264.     (disable-self)
  1265. )
  1266.  
  1267. (defrule
  1268.     (goal personality 10)
  1269.     (or
  1270.         (stance-toward any-human neutral)
  1271.         (stance-toward any-human ally)
  1272.     )
  1273. =>
  1274.     (chat-to-player-using-id this-any-human 22025)
  1275.     (chat-to-player-using-id this-any-human 22026)
  1276.         ;"So! Thou has chosen to defy me." 
  1277.         ;"It shall be war to the knife!"
  1278.     (set-stance this-any-human enemy)
  1279.     (set-stance every-computer ally)
  1280.     (disable-timer t-chathelp)
  1281.     (disable-timer t-chat)
  1282.     (disable-self)
  1283. )
  1284. #end-if
  1285. ;**************************************
  1286.